home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / walpeep / wallpap.frm < prev    next >
Text File  |  1995-05-08  |  5KB  |  174 lines

  1. VERSION 2.00
  2. Begin Form Form2 
  3.    AutoRedraw      =   -1  'True
  4.    Caption         =   "Preview"
  5.    ClientHeight    =   1470
  6.    ClientLeft      =   120
  7.    ClientTop       =   5160
  8.    ClientWidth     =   4485
  9.    ControlBox      =   0   'False
  10.    DrawStyle       =   3  'Dash-Dot
  11.    FillStyle       =   0  'Solid
  12.    Height          =   1875
  13.    Icon            =   WALLPAP.FRX:0000
  14.    Left            =   60
  15.    LinkMode        =   1  'Source
  16.    LinkTopic       =   "Form2"
  17.    ScaleHeight     =   98
  18.    ScaleMode       =   3  'Pixel
  19.    ScaleWidth      =   299
  20.    Top             =   4815
  21.    Width           =   4605
  22.    Begin PictureBox Picture1 
  23.       BackColor       =   &H00C0C0C0&
  24.       Height          =   120
  25.       Left            =   0
  26.       ScaleHeight     =   6
  27.       ScaleMode       =   3  'Pixel
  28.       ScaleWidth      =   6
  29.       TabIndex        =   1
  30.       Top             =   30
  31.       Width           =   120
  32.    End
  33.    Begin PictureBox DestinationPic 
  34.       AutoSize        =   -1  'True
  35.       DrawMode        =   1  'Blackness
  36.       DrawStyle       =   3  'Dash-Dot
  37.       Height          =   195
  38.       Left            =   -30
  39.       ScaleHeight     =   11
  40.       ScaleMode       =   3  'Pixel
  41.       ScaleWidth      =   13
  42.       TabIndex        =   0
  43.       Top             =   -15
  44.       Width           =   225
  45.    End
  46. End
  47.  
  48. Sub DestinationPic_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  49. If Not InPic1 Then Exit Sub
  50. Form1.Timer1.Enabled = False
  51. Dragging = True
  52. DestinationPic.AutoRedraw = False
  53. If Not Metafile Then
  54.    Call DragPictureTo(Int(X), Int(Y), Shift)
  55. End If
  56. End Sub
  57.  
  58. Sub DestinationPic_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  59. If Dragging Then
  60.    MousePointer = 8
  61.    If DestinationPic.Left + X > ScaleWidth Then X = ScaleWidth - DestinationPic.Left
  62.    'If Y > ScaleHeight + 2 Then Y = ScaleHeight + 2
  63.    If DestinationPic.Top + Y > ScaleHeight Then Y = ScaleHeight - DestinationPic.Top
  64.    'Carole Rogers roooooolzzzzz!
  65.    If X * Y > 180000 Then
  66.       newY = Sqr(180000 * Y / X)
  67.       newX = 180000 / newY
  68.       X = newX
  69.       Y = newY
  70.    End If
  71.    Call DragPictureTo(Int(X), Int(Y), Shift)
  72. Else
  73.    MousePointer = 0
  74.    'Beep
  75. End If
  76. End Sub
  77.  
  78. Sub DestinationPic_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  79. If Not InPic1 Then Exit Sub
  80. Moving = False
  81. gDrawing = False
  82. DoEvents
  83. If Not Metafile Then Call DestinationPic_MouseMove(Button, Shift, X, Y)
  84. Dragging = False   'stop moving this up!!!!
  85.                    'it belongs after the mouse_move call
  86. 'Call DestinationPic_MouseMove(Button, Shift, X, Y)
  87. 'Call DestinationPic_MouseMove(Button, Shift, X, Y)
  88. 'Call DestinationPic_MouseMove(Button, Shift, X, Y)
  89.  
  90. DestinationPic.AutoRedraw = False
  91. NonPersistentHDC = DestinationPic.hDC
  92. DestinationPic.AutoRedraw = True
  93. PersistentHDC = DestinationPic.hDC
  94. dwRop& = &HCC0020
  95. DoEvents
  96. T% = BitBlt%(PersistentHDC, 0, 0, DestinationPic.Width, DestinationPic.Height, NonPersistentHDC, 0, 0, dwRop&)
  97. DoEvents
  98. Call WallPaper
  99. Form1.Timer1.Enabled = True
  100. End Sub
  101.  
  102. Sub Form_DblClick ()
  103. If Form1.ShowAllFiles.Value = 0 Then
  104.    Call File1DClick
  105. Else
  106.    Call List1DClick
  107. End If
  108. End Sub
  109.  
  110. Sub Form_Load ()
  111. 'Top = Form1.Top
  112. Top = Form1.Top + Form1.Height - 15
  113. Left = Form1.Left
  114. Width = Form1.Width
  115. End Sub
  116.  
  117. Sub Form_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  118. MousePointer = 0
  119. End Sub
  120.  
  121. Sub Form_Resize ()
  122. 'Command1.Width = ScaleWidth
  123. 'Form2.Visible = True
  124. If Form2.WindowState = 1 Then ' minimized
  125.       Form2.Visible = False
  126.       Form2.WindowState = 0
  127.       Form1.WindowState = 1
  128.    Else
  129.       Form2.Visible = True
  130. End If
  131. If Not Loading% Then
  132.    Call DragPictureTo((Form2.DestinationPic.Width), (Form2.DestinationPic.Height), False)
  133.    Call WallPaper
  134.    Call PositionOutline
  135.    Call DottedLine
  136. End If
  137. End Sub
  138.  
  139. Sub Form_Unload (Cancel As Integer)
  140. End
  141. End Sub
  142.  
  143. Sub Picture1_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  144. InPic1 = True
  145. MousePointer = 8
  146. Picture1.Visible = False
  147. Picture1.Left = Picture1.Left + X
  148. Picture1.Top = Picture1.Top + Y
  149. Call DestinationPic_MouseDown(Button, Shift, (Picture1.Left - DestinationPic.Left), (Picture1.Top - DestinationPic.Top))
  150. End Sub
  151.  
  152. Sub Picture1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  153. MousePointer = 8
  154. If Not InPic1 Then Exit Sub
  155. Call DestinationPic_MouseMove(Button, Shift, (Picture1.Left - DestinationPic.Left) + X, (Picture1.Top - DestinationPic.Top) + Y)
  156. 'Call DestinationPic_MouseMove(Button, Shift, (Picture1.Left) + X, (Picture1.Top) + Y)
  157. End Sub
  158.  
  159. Sub Picture1_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  160. Call DestinationPic_MouseUp(Button, Shift, (Picture1.Left - DestinationPic.Left) + X, (Picture1.Top - DestinationPic.Top) + Y)
  161. 'Call DestinationPic_MouseUp(Button, Shift, Picture1.Left + X, Picture1.Top + Y)
  162. Picture1.Left = DestinationPic.Left + DestinationPic.Width - Picture1.Width - 1
  163. Picture1.Top = DestinationPic.Top + DestinationPic.Height - Picture1.Height - 1
  164.  
  165. Form2.DestinationPic.Line (0, 0)-(Form2.DestinationPic.Width, 0)
  166.  
  167. Picture1.Visible = True
  168. InPic1 = False
  169. MousePointer = 0
  170. Call DottedLine
  171. 'Beep
  172. End Sub
  173.  
  174.